// var request = require('request');
const query = require('../mysql/pool.js')
const TEST_TABLE = 'test';

// 列表
module.exports = async ctx => {
    // ctx.request.url = 'http://hq.sinajs.cn/list=CON_OP_10000001'
    // console.log('ctx.request', ctx.request)
    // ctx.query
    const data = await query("SELECT * FROM " + TEST_TABLE)
    ctx.state.data = data
    // console.log(ctx.request.body)
    // console.log(ctx.body)
    // request('http://hq.sinajs.cn/list=CON_OP_10000001', (error, response, body) => {
    //     console.log('error:', error); // Print the error if one occurred
    //     console.log('statusCode:', response && response.statusCode); // Print the response status code if a response was received
    //     console.log('body:', body); // Print the HTML for the Google homepage.
    // });
}